package com.example.alibabanacosdiscoveryclient01.config.ai;

import com.example.alibabanacosdiscoveryclient01.service.MockOrderService;
import com.example.alibabanacosdiscoveryclient01.service.impl.MockOrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

/**
 * @author:guoq
 * @date:2025/1/16
 * @descripion:  声明式的注册functionCalling
 */
@Configuration
public class FunctionCallConfig {
    @Bean
    @Description("Get the order") // function description
    public Function<MockOrderServiceImpl.Request,MockOrderServiceImpl.Response> orderFunction(MockOrderService mockOrderService) {
        return mockOrderService::mockOrder;
    }
}
